knife = {
  spriteX = 45,
  spriteY = 15,
  x,
  y,
  dx,
  dy,
  charQuads = {},
  charImage = love.graphics.newImage("images/sprites/knife.png"),
  direction = 0, -- 0 Left / 1 Right
  speed = 300,
  damage = 20,

  loadImage = function()
    local count = 1  
    for i = 0, 1, 1 do
      if(knife.charQuads[i] == nil) then 
        knife.charQuads[i] = {}
      end
      knife.charQuads[i] = love.graphics.newQuad(i * knife.spriteX, 0, knife.spriteX, knife.spriteY, knife.charImage:getWidth(), knife.charImage:getHeight())
      count = count + 1
    end
  end
}

-- Not used yet
function knife:checkCollision(x1,y1,w1,h1,x2,y2,w2,h2)
  return x1 < x2+w2 and x2 < x1+w1 and y1 < y2+h2 and y2 < y1+h1
end  

-- Returns a new knife instance
-- New knife is created with the main knife images, no need to load again
function knife:GetInstance()
  return {
    spriteX = knife.spriteX,
    spriteY = knife.spriteY,
    x,
    y,
    dx,
    dy,
    charQuads = knife.charQuads,
    charImage = knife.charImage,
    direction = 0, -- 0 Left / 1 Right
    speed = knife.speed,
    damage = knife.damage,
  }
end